# Contributor: Katie Holly <holly@fuslvz.ws>
# Maintainer: Katie Holly <holly@fuslvz.ws>
pkgname=lyrebird
pkgver=0.1.0
pkgrel=4
pkgdesc="pluggable transport proxy for Tor, implementing obfs4"
url="https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird"
arch="all"
license="BSD-3-Clause"
makedepends="go"
source="$pkgname-$pkgver.tar.bz2::https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/lyrebird/-/archive/lyrebird-$pkgver/lyrebird-lyrebird-$pkgver.tar.bz2"
builddir="$srcdir/lyrebird-lyrebird-$pkgver"

# it used to be named this upstream
provides="obfs4proxy=$pkgver-r$pkgrel"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -o lyrebird ./cmd/lyrebird
}

check() {
	go test -short ./...
}

package() {
	install -Dm755 lyrebird -t "$pkgdir"/usr/bin/
}

sha512sums="
f9b8686d1c5f9ddb41a255a1a8954e05cefd50523ada7360432b456c62475ba606872df407ba8ebd7714d4f185eef0efae63e3e53c5c1c18fd323a97912f951e  lyrebird-0.1.0.tar.bz2
"
